home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / UNIXLIB37B / !UnixLib37 / src / unix / c / waitpid < prev    next >
Text File  |  1996-11-09  |  1KB  |  46 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/unix/c/RCS/waitpid,v $
  4.  * $Date: 1996/05/06 09:03:14 $
  5.  * $Revision: 1.1 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: waitpid,v $
  10.  * Revision 1.1  1996/05/06 09:03:14  unixlib
  11.  * Initial revision
  12.  *
  13.  ***************************************************************************/
  14.  
  15. static const char rcs_id[] = "$Id: waitpid,v 1.1 1996/05/06 09:03:14 unixlib Rel $";
  16.  
  17. #include <errno.h>
  18. #include <sys/wait.h>
  19. #include <sys/types.h>
  20. #include <stddef.h>
  21.  
  22. /* Wait for a child matching pid to die.
  23.  
  24.    If pid > 0, match any process whose process ID is pid.
  25.    If pid = -1, match any process.
  26.    If pid = 0, match any process with the same process group
  27.    as the current process.
  28.    If pid < -1, match any process whose process group is the
  29.    absolute value of pid.
  30.  
  31.    If the WNOHANG bit is set in options, and that child
  32.    is not already dead, return (pid_t) 0.
  33.  
  34.    If successful, return pid and store the dead child's status in stat_loc.
  35.  
  36.    Return -1 for errors.
  37.  
  38.    If the WUNTRACED bit is set in OPTIONS, return status for stopped
  39.    children; otherwise don't.  */
  40.  
  41. pid_t
  42. waitpid (pid_t pid, int *stat_loc, int options)
  43. {
  44.   return wait4 (pid, stat_loc, options, NULL);
  45. }
  46.